/********************************************************************************
  * @file     main.c
  * @author   TEST TEAM
  * @version  v0
  * @date     2023.12
  * @brief    Main Interrupt Service Routines.
  *           This file provides template for all exceptions handler and
  *           peripherals interrupt service routine.
  *
  * Copyright (C) 2023  Hangzhou SDIC Microelectronics Co., Ltd
*********************************************************************************/

/*Includes*/
#include "aky_com_include.h"



#if 00 // BP004
#define LED_TEST_PIN P02
#define LED_TEST_PIN_SET_OUTPUT_IDLE \
    P0M |= 0X01 << 2;                \
    P0UR &= ~(0X01 << 2)
#define LED_TEST_PIN_ON LED_TEST_PIN = 1
#define LED_TEST_PIN_OFF LED_TEST_PIN = 0
#define LED_TEST_PIN_FLIP()                                  \
    (LED_TEST_PIN) ? (LED_TEST_PIN_OFF) : (LED_TEST_PIN_ON); \
    LED_TEST_PIN_SET_OUTPUT_IDLE // 翻转电平

#endif
int main(void)
{	
    uint16_t debug_buf[5] = {0x1122, 0x2233, 0x3344, 0x4455 ,0x5566};
    uint16_t i;

    aky_sys_init();

    aky_tick_delay_ms(200);

    if (KEY_POWER == 0 && KEY_SET == 0 && KEY_MEM == 0 )
    {
        g_e_sys_stat = FAST_TEST_MODE; 
        IsPowerOn = 1;
    }    

    while (1)
    {
        switch (g_e_sys_stat)
        {
        case FIRST_UP_MODE:
        {
            first_up_mode();
            break;
        }
        case STOP_MODE:
        {
            stop_mode();
            break;
        }
        case LINEAR_MODE:
        {
            linear_mode();
            break;
        }
        case CAL_MODE:
        {
            auto_cal_mode();
            break;
        }
        case MENU_SEL_MODE:
        {
            menu_sel_mode();
            break;
        }        
        case SET_MODE:
        {
            set_mode();
            break;
        }       
        case LOW_BAT_MODE:
        {
            low_bat_mode();
            break;
        }      
        case CHARGE_MODE:
        {
            charge_mode();
            break;
        }        
        case LEAK_TEST_MODE:
        {
            LeakTest();
            break;
        }          
        case AIR_TIGHT_TEST_MODE:
        {
            air_tight_test();
            break;
        }         
        case INFLAT_DEFLAT_TIME_TEST_MODE:
        {
            inflat_deflat_time_test();
            break;
        }      
        case PRES_METER_MODE:
        {
            pres_meter_mode();
            break;
        }           
        case FAST_TEST_MODE:
        {
            fast_test_mode();
            break;
        }   

        default:
        {
            g_e_sys_stat = STOP_MODE;
            break;
        }
        }

    }
    
}



/****************************END OF FILE****************************/
